package org.flower.web.servlet;

import com.alibaba.fastjson.JSON;
import org.flower.entity.User;
import org.flower.service.UserService;
import org.flower.service.impl.UserServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(value = "/UserUpdatePwdServlet.shtml")
public class UserUpdatePwdServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        User user=(User)request.getSession().getAttribute("user") ;
        UserService userService =new UserServiceImpl();
        if(user!=null){
            String userStr = JSON.toJSONString(user);
            response.getWriter().print(userStr);
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
